// 农事管理相关接口
import http from '@/utils/httpRequest'

// 通过id 获取农事详情参数
export function queryDetailData (detailId) {
  return http({
    url: '/api/affairs/landController/getLandById/' + detailId,
    method: 'get'
  })
}

//
// 查询巡田人员下拉数据
export function querySelectInspectionList () {
  return http({
    url: '/api/affairs/permissionController/selectInspectionList',
    method: 'get'
  })
}

// 删除地块
export function deleteLands (data) {
  return http({
    url: '/api/affairs/landController/deleteLands',
    method: 'post',
    data
  })
}

// 获取地块当前种植方案接口
export function queryPlantByLandId (id) {
  return http({
    url: `/api/affairs/plantController/getPlantByLandId?landId=${id}`,
    method: 'post'
  })
}

// 添加种植方案
export function addLand (data) {
  return http({
    url: '/api/affairs/plantController/savePlant',
    method: 'post',
    data
  })
}

// 结束种植方案
export function endLand (data) {
  return http({
    url: '/api/affairs/plantController/updatePlantEnd',
    method: 'post',
    data
  })
}
// 获取使用复合肥种类接口
export function fertilizerType (data) {
  return http({
    url: `/api/material/goods/list/?id=${data.id}&string=${data.string}`,
    method: 'get'
  })
}
// 获取作物类型组织树接口+作物品种接口
export function CropType (id) {
  return http({
    url: `/api/material/goods/treeselect?id=${id}`,
    method: 'get'
  })
}

// 获取地块种植历史
export function selectPlantHistory (data) {
  return http({
    url: `/api/affairs/plantController/selectPlantHistory`,
    method: 'post',
    data
  })
}
